package com.example.boss.db.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.boss.db.gen.diaryList;
import com.example.boss.db.gen.diaryPwd;
import com.example.boss.db.gen.diaryTag;
import com.example.boss.db.gen.Note;

import com.example.boss.db.gen.diaryListDao;
import com.example.boss.db.gen.diaryPwdDao;
import com.example.boss.db.gen.diaryTagDao;
import com.example.boss.db.gen.NoteDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig diaryListDaoConfig;
    private final DaoConfig diaryPwdDaoConfig;
    private final DaoConfig diaryTagDaoConfig;
    private final DaoConfig noteDaoConfig;

    private final diaryListDao diaryListDao;
    private final diaryPwdDao diaryPwdDao;
    private final diaryTagDao diaryTagDao;
    private final NoteDao noteDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        diaryListDaoConfig = daoConfigMap.get(diaryListDao.class).clone();
        diaryListDaoConfig.initIdentityScope(type);

        diaryPwdDaoConfig = daoConfigMap.get(diaryPwdDao.class).clone();
        diaryPwdDaoConfig.initIdentityScope(type);

        diaryTagDaoConfig = daoConfigMap.get(diaryTagDao.class).clone();
        diaryTagDaoConfig.initIdentityScope(type);

        noteDaoConfig = daoConfigMap.get(NoteDao.class).clone();
        noteDaoConfig.initIdentityScope(type);

        diaryListDao = new diaryListDao(diaryListDaoConfig, this);
        diaryPwdDao = new diaryPwdDao(diaryPwdDaoConfig, this);
        diaryTagDao = new diaryTagDao(diaryTagDaoConfig, this);
        noteDao = new NoteDao(noteDaoConfig, this);

        registerDao(diaryList.class, diaryListDao);
        registerDao(diaryPwd.class, diaryPwdDao);
        registerDao(diaryTag.class, diaryTagDao);
        registerDao(Note.class, noteDao);
    }
    
    public void clear() {
        diaryListDaoConfig.getIdentityScope().clear();
        diaryPwdDaoConfig.getIdentityScope().clear();
        diaryTagDaoConfig.getIdentityScope().clear();
        noteDaoConfig.getIdentityScope().clear();
    }

    public diaryListDao getDiaryListDao() {
        return diaryListDao;
    }

    public diaryPwdDao getDiaryPwdDao() {
        return diaryPwdDao;
    }

    public diaryTagDao getDiaryTagDao() {
        return diaryTagDao;
    }

    public NoteDao getNoteDao() {
        return noteDao;
    }

}
